<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<security:authentication property="principal.originalAdmin.menu" var="menuList"/>
<div class="col-sm-3 col-md-2 sidebar">
	<div class="tree">
		<ul style="padding-left: 0px;" class="list-group">
			<c:forEach items="${menuList}" var="menu">
				<li class="list-group-item">
					<a <c:if test="${menu.url != null && menu.url !=''}">href="${menu.url}"</c:if> >
						<c:if test="${empty menu.children }">
							<i class="${menu.icon}"></i> ${menu.name}
						</c:if>
						<c:if test="${!empty menu.children }">
							<span>
								<i class="${menu.icon}"></i> ${menu.name}
								<span class="badge" style="float: right">${menu.children.size()}</span>
							</span>
							<ul style="margin-top: 10px;">
							<c:forEach items="${menu.children}" var="menu1">
								<li style="height: 30px;">
									<a <c:if test="${menu1.url != null && menu1.url !=''}">href="${menu1.url}"</c:if> >
										<i class="${menu1.icon}"></i> ${menu1.name}
									</a>
								</li>
							</c:forEach>
							</ul>
						</c:if>
					</a>
				</li>
			</c:forEach>
		</ul>
	</div>
</div>